UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gxgr7k/v2f3ZIlSzsArSvlgUGlt1ptd+epu4OoYUQJY='
WHERE
key_id = '65d80fd6bc5d26b1753c46fbbf4eb843a5acab0a8b4cda627fb284ca6c83f999'
AND (
token = 'Gxgr7k/v2f3ZIlSzsArSvlgUGlt1ptd+epu4OoYUQJY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)