UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6znBhU0UTZYeLS0KvWvojdFDopuS91l4lcbp41JQNg4='
WHERE
key_id = '44e9c2809071967b1a72c9ce146c45c23d521fbdd2c8968668a6321a530a5511'
AND (
token = '6znBhU0UTZYeLS0KvWvojdFDopuS91l4lcbp41JQNg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)