UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4STd6GD/0zz/Rz4/aNgVyOE9GnVKz12uNKPNUxiliBE='
WHERE
key_id = 'f2f8156d341a930ba606b414906f878cf526b35d0fd307eaabbad17c41ce0446'
AND (
token = '4STd6GD/0zz/Rz4/aNgVyOE9GnVKz12uNKPNUxiliBE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)