UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MnXjdQ+2tgfKgl/c3uTS1sg2mxal1178lGTtxtv2lPg=' 
WHERE 
  key_id = '041911c144bdae73fcdf70c068de7432b81c08abe02068350d036adba09a79d8' 
  AND (
    token = 'MnXjdQ+2tgfKgl/c3uTS1sg2mxal1178lGTtxtv2lPg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041