UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fCyb+/byRFKf5RqqeUvVVWWEircVaHmunErkutGcHaE='
WHERE
key_id = 'e87033d426259c094b24ebe94786dde7747829010e96b058593db1f5adc4fbbe'
AND (
token = 'fCyb+/byRFKf5RqqeUvVVWWEircVaHmunErkutGcHaE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)