UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7vUtnDzDdre2Ee4iZa+PWhKMcct1wAzThsjQaxOtjSk=' 
WHERE 
  key_id = '3ea89bde36255c203e37a867a0111685b93f8703fa134c2f874ec628178fd11b' 
  AND (
    token = '7vUtnDzDdre2Ee4iZa+PWhKMcct1wAzThsjQaxOtjSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037