UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'runHn781FWHnZ1KJxatLcXfTHPJuyR1oQFHZyP3jItQ='
WHERE
key_id = 'fa1caa1e76203853c10970a3f92f834f1155312fcd8bbbc8223b0ba5c6363678'
AND (
token = 'runHn781FWHnZ1KJxatLcXfTHPJuyR1oQFHZyP3jItQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)