UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Aex5c6C+CTgwDak+9W2VShonZcakuUR1kOd9mvfOGIM=' 
WHERE 
  key_id = 'ef0b0ced9359b7b5bb6dd7ef7d89afa4e7393c07d54863e1080e2269871869b7' 
  AND (
    token = 'Aex5c6C+CTgwDak+9W2VShonZcakuUR1kOd9mvfOGIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030