UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r/zSHlsb3y+QsITa/vMOL3ZZnj4lG1V3cuQiUI5Qk3k=' 
WHERE 
  key_id = 'c7e3f662546e5ee0ebcc3c7aa03e428d6195268a9445cb697bb0145c4a2db8aa' 
  AND (
    token = 'r/zSHlsb3y+QsITa/vMOL3ZZnj4lG1V3cuQiUI5Qk3k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048