UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E/DShhyuqbFhWDId/wG4o2Z19Bkey37950GzxCOb3Nk='
WHERE
key_id = 'c73236e1f3330ecdff1c6cd719fbea75d949aa38b036eb4b19c6cbc7f2ffbf7b'
AND (
token = 'E/DShhyuqbFhWDId/wG4o2Z19Bkey37950GzxCOb3Nk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)