UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LO718McfRbJI84Z+HTKd2cIqGLVzfkvgB/NDB6GxH9o='
WHERE
key_id = '1ece41b3aa9581788b2ba728a21d185ee2af91ddbdabb4ff65534b6192cc306f'
AND (
token = 'LO718McfRbJI84Z+HTKd2cIqGLVzfkvgB/NDB6GxH9o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)