UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZceYujAjFtXTwGlVG38wd8G00IzmoFSxX6UiFKNsmfk=' 
WHERE 
  key_id = '2d8ddaad9f1a9cb7ec0c8bf0e9ebccc4080076f6978f0d5e8bc791b45eb6c669' 
  AND (
    token = 'ZceYujAjFtXTwGlVG38wd8G00IzmoFSxX6UiFKNsmfk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041