UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3dzryxkZI5Ly3zf4DzYOfGs2Bg0E6eQiImYUb8QLb78='
WHERE
key_id = '942eea6770069c1d968051019e957cf264dbea5ed4bd176d6818e331bdb2708c'
AND (
token = '3dzryxkZI5Ly3zf4DzYOfGs2Bg0E6eQiImYUb8QLb78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)