UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ww95UZ2QzjDXxVpSzHVBmjenzjHO+eL4aSqpc+dO9IY='
WHERE
key_id = '6af236b0a3630502195d916890409f6e1885de9e190cbdbe04fe4fb7f46858ec'
AND (
token = 'Ww95UZ2QzjDXxVpSzHVBmjenzjHO+eL4aSqpc+dO9IY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)