UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YPsDfZF6tEQapG/ha86TCwD5Z1J8iQkWxpKsAm9PsL8='
WHERE
key_id = '203538ddd4134c4cd3520d35f32b5ac80bb1edc0af30b4ec152d1c5b373a8676'
AND (
token = 'YPsDfZF6tEQapG/ha86TCwD5Z1J8iQkWxpKsAm9PsL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)