UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+dcOaFhTYsZqCW/3e/aKFd+rsXTAC26JkrV/fbULt8A=' 
WHERE 
  key_id = '3f2e750d426dc303b4bff8bc7531ec5d29547d290029d2cd194760d478d16c20' 
  AND (
    token = '+dcOaFhTYsZqCW/3e/aKFd+rsXTAC26JkrV/fbULt8A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028