UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kdCoWkFOto2Hw23D7FNC8KVaaN1/2y9r/F54qA6zVgw=' 
WHERE 
  key_id = 'edb6fa440361ebe273b749d389e9248c9db5436b67bc1e54fa4d5d5ef3373ce0' 
  AND (
    token = 'kdCoWkFOto2Hw23D7FNC8KVaaN1/2y9r/F54qA6zVgw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027