UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qAqOXAQZ2wbCf70e8qFCanY/G7wnPh9KWnyKotTIlCg=' 
WHERE 
  key_id = 'abf096c0013c20d98754440342f9e449a702af78e7da785edd482b216258f84b' 
  AND (
    token = 'qAqOXAQZ2wbCf70e8qFCanY/G7wnPh9KWnyKotTIlCg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030