UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7xHxuGr5R0SIbQa8rN+5Pnd9oAidto3oiAWErRNY2ek='
WHERE
key_id = '591ee101a692fb9d69bbd5527e5d3d3e6530c56fda4aa7087070cdbd71cb1b20'
AND (
token = '7xHxuGr5R0SIbQa8rN+5Pnd9oAidto3oiAWErRNY2ek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)