UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PkKfqRYKOSZ01G9Y9Fq3bNMaqS3CvoIEDpXkZFSBpJU=' 
WHERE 
  key_id = '68d79896cc68735dbeffc5b4a6f5c0adeb6d50e4346cbac81673895793bb5cd6' 
  AND (
    token = 'PkKfqRYKOSZ01G9Y9Fq3bNMaqS3CvoIEDpXkZFSBpJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054