UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nxIw4mMdwVx+muLWQUpau23s4lvxBryVk7sXHXvqCh4=' 
WHERE 
  key_id = '11c8fb6931678941d63c4d3505a5cd5a82730692b340df2890ed73179444e506' 
  AND (
    token = 'nxIw4mMdwVx+muLWQUpau23s4lvxBryVk7sXHXvqCh4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00091