UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FTAq/YDOkvkUSquafFNX1TnzQrZocRTDK/Ag2Yze8ZU=' 
WHERE 
  key_id = '54d028dc52e2180068b8f7dfe2ec451875de043e808c751c4c9004955dd232ae' 
  AND (
    token = 'FTAq/YDOkvkUSquafFNX1TnzQrZocRTDK/Ag2Yze8ZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034