UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3ROLt2u5qfvuf7quS7kj+zkToqVpX/KEc5w0S4QYgJg='
WHERE
key_id = '622188781a5cf335e101dbd1cf0156044a1bd77f1aeb02d0cbda6f99b8e38841'
AND (
token = '3ROLt2u5qfvuf7quS7kj+zkToqVpX/KEc5w0S4QYgJg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)