UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2hveR53g0V+AaUBz/V8PgZIMHnYSYDaUZMHadTQ28hQ='
WHERE
key_id = 'd6e8a113d918882e201bf19023ed7470194b32eba86379bf6c1ed97cf717d22e'
AND (
token = '2hveR53g0V+AaUBz/V8PgZIMHnYSYDaUZMHadTQ28hQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)