UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q45JkFGOqdAl5xrf3Q4dHUQkEA78Sf7juWGF0dyzFHE=' 
WHERE 
  key_id = '15dfbcf447781e5fcea2ae8f291c790f8cda278c9ebedc3e9b8aa13640e52903' 
  AND (
    token = 'q45JkFGOqdAl5xrf3Q4dHUQkEA78Sf7juWGF0dyzFHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027