UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OpcK5Mk5W4xritkXfvNRaX8Hl/CCpfy3C0mQRuPqWqI=' 
WHERE 
  key_id = '87142ccdf075ba1ce0cfe391c0c06e61db5f874cea3ee669c6cadbaf7752692a' 
  AND (
    token = 'OpcK5Mk5W4xritkXfvNRaX8Hl/CCpfy3C0mQRuPqWqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056