UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G+y32wA9Pg2EnG5xsLdGsAtOU5NV/4xVhbk39q5uOWo='
WHERE
key_id = '74453b5af09c14a13ca5776a701575e3b0fcb53a0fdafe2b102653ad0c0cd7aa'
AND (
token = 'G+y32wA9Pg2EnG5xsLdGsAtOU5NV/4xVhbk39q5uOWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)