UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w+8mo3nx2LXnrenS1a4hQVd5F7mvU0VjCM/pZR/y6UA='
WHERE
key_id = 'a100c52c3ed173f27ac4ef6563ce2dd1763698e19346d37e2bc05a131df30cf3'
AND (
token = 'w+8mo3nx2LXnrenS1a4hQVd5F7mvU0VjCM/pZR/y6UA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)