UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ist/lxv87gnmPhxgMpDZ79s9ksUpkyUjkeOBqAZ3VSE='
WHERE
key_id = 'dde3b7a1aaed20dcab6fe3fbe433ea15fe3e92179c0a251a8f5409fc524ecf1b'
AND (
token = 'ist/lxv87gnmPhxgMpDZ79s9ksUpkyUjkeOBqAZ3VSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)