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