UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7ZnO0G5tengFWDsb+aCvoIzlLR+7rl13SIEE0kkoE5I=' 
WHERE 
  key_id = '582ac1165e7756c75f8337992ffe44a0b900014c1ff290e6d6b3a72b5ce006e9' 
  AND (
    token = '7ZnO0G5tengFWDsb+aCvoIzlLR+7rl13SIEE0kkoE5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032