UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hyWBgAexK7bQDRUV6wfSWn7P3A0tWtIieGLzQiGgr6A=' 
WHERE 
  key_id = 'a3e783cb43a9938d4926ea713df031702496813b7381c93210fa08c4d1b834ea' 
  AND (
    token = 'hyWBgAexK7bQDRUV6wfSWn7P3A0tWtIieGLzQiGgr6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021