UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OKiaEw8iVQMiz3Gu6IUQTnB/hoTbWQihIhIR6hK8VWs=' 
WHERE 
  key_id = '1561fe278749f0bd8a8e9f6b5ebd6026590d95ef37dea6cb7925f009a87c6f9a' 
  AND (
    token = 'OKiaEw8iVQMiz3Gu6IUQTnB/hoTbWQihIhIR6hK8VWs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048