UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pC+i3DidX6AKpoGLXY1UezM3irh9Wa/wOuP8NG52jO4='
WHERE
key_id = '4b331e7652b7805338cba486feefb5a83a50d45104edced959bd9fd5608ceaf2'
AND (
token = 'pC+i3DidX6AKpoGLXY1UezM3irh9Wa/wOuP8NG52jO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)