UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BicopKgX+qhQxU22YxH+/TI8+x9EiyJv6HzkoJsuz0w='
WHERE
key_id = 'fa03c3ede9b9585a3a1e355a2218243261b0cd55200510dd18f68920ce8b730d'
AND (
token = 'BicopKgX+qhQxU22YxH+/TI8+x9EiyJv6HzkoJsuz0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)