UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bVAuNAnd0kFDXJ2LCclotvBmT43wbrWst1sViLbUk/g=' 
WHERE 
  key_id = '8df3fd07983969c5a1c4e52d5c52c7cce14f0087ad576c179c8c3e1e7c24d74c' 
  AND (
    token = 'bVAuNAnd0kFDXJ2LCclotvBmT43wbrWst1sViLbUk/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042