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