UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a6znInHQ4MWk+Aafhy41iUh/d6fbo5yt3MP62QEEFYg='
WHERE
key_id = '6f3d765269b157200f81ea767bb43a64032f10ca28e8ce3d9593d51eadfc6298'
AND (
token = 'a6znInHQ4MWk+Aafhy41iUh/d6fbo5yt3MP62QEEFYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)