UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+icU4cXxWcOwXfXvYVVmsh63ptUiiv9u1MJTtvt94E4='
WHERE
key_id = '5d867c59dbdb397bc605ef6116e7c6918c44ec2119cda8ca27c01c38e79123c8'
AND (
token = '+icU4cXxWcOwXfXvYVVmsh63ptUiiv9u1MJTtvt94E4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)